home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 14454 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.1 KB

  1. Path: mail2news.demon.co.uk!genesis.demon.co.uk
  2. From: Lawrence Kirby <fred@genesis.demon.co.uk>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Check if a file exists?
  5. Date: Sun, 14 Apr 96 23:32:08 GMT
  6. Organization: none
  7. Message-ID: <829524728snz@genesis.demon.co.uk>
  8. References: <4kp7pg$upe@news-s01.ny.us.ibm.net> <829481378snz@genesis.demon.co.uk> <4kr8n9INN4he@keats.ugrad.cs.ubc.ca>
  9. Reply-To: fred@genesis.demon.co.uk
  10. X-NNTP-Posting-Host: genesis.demon.co.uk
  11. X-Newsreader: Demon Internet Simple News v1.27
  12. X-Mail2News-Path: genesis.demon.co.uk
  13.  
  14. In article <4kr8n9INN4he@keats.ugrad.cs.ubc.ca>
  15.            c2a192@ugrad.cs.ubc.ca "Kazimir Kylheku" writes:
  16.  
  17. >In article <829481378snz@genesis.demon.co.uk>,
  18. >Lawrence Kirby  <fred@genesis.demon.co.uk> wrote:
  19. >>In article <4kp7pg$upe@news-s01.ny.us.ibm.net>
  20. >>           bfilone@ibm.net "bfilone@ibm.net " writes:
  21. >>
  22. >>>Is it possible in C to check if a file exists other than checking for a
  23. >>> succesful fopen?
  24. >>
  25. >>There is no other way in standard C. The only standard C library functions
  26. >>that actually take a filename are fopen, freopen, rename and remove.
  27. >
  28. >But even so, Lawrence, how can you be sure that a successful fopen() means that
  29. >the file really *exists*? Do computers exist?
  30.  
  31. Without doubt. There's just no way my imagination could have created the
  32. IBM PC.
  33.  
  34. >It seems that one has to approach fopen() with a certain metaphysical
  35. >predisposition that a file really *can* exist.
  36.  
  37. You're right of course. fopen() just tests whether a file is readable,
  38. writable or both.
  39.  
  40. >The proper discussion of file existence is to be found somewhere in alt.kooks
  41. >and not comp.lang.c. As far as the standard is concerned, all that fopen()
  42. >means is that certain things are logically possible that wouldn't be if fopen()
  43. >failed. Assuming fopen() exists, of course. But that is off topic.
  44.  
  45. It is defined in the sacred texts, therefore it exists (at least in the
  46. hosted parallel universe).
  47.  
  48. -- 
  49. -----------------------------------------
  50. Lawrence Kirby | fred@genesis.demon.co.uk
  51. Wilts, England | 70734.126@compuserve.com
  52. -----------------------------------------
  53.